package bishi.kaizi;

import java.util.*;

public class _04 {
    static int res = 0;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();
        int[][] nums = new int[n][2];
        boolean[] over = new boolean[m + 1];
        for (int i = 0; i < n; i++) {
            nums[i][0] = sc.nextInt();
            nums[i][1] = sc.nextInt();
        }
        dfs(nums, over, 0, 0);
        System.out.println(res);
    }

    public static void dfs(int[][] nums, boolean[] over, int nowI, int nowRes) {
        for (int i = nowI; i < nums.length; i++) {
            if (!over[nums[i][0]] && !over[nums[i][1]]) {
                over[nums[i][0]] = true;
                over[nums[i][1]] = true;
                dfs(nums, over, nowI + 1, nowRes + 1);
                over[nums[i][0]] = false;
                over[nums[i][1]] = false;
            }
        }
        res = Math.max(res, nowRes);
    }
}
